﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Runtime.Serialization;

using PTTWebSite;

namespace PPTWCF
{
    //[ServiceContract(Namespace = "")]
    [ServiceContract]
    public interface IInfoService
    {
        [OperationContract]
        string DoWork();

        //[OperationContract]
        //void RemoveOlderThen4Min();

        [OperationContract]
        void InsertNewPosition(int VNumber, string Vtype, string userid, float lan, float lon);

        [OperationContract]
        List<StationListItem> ListStations(int vNumber, string vType);

        [OperationContract]
        String GetID(float lat, float lon);

        [OperationContract]
        int getTimeFromStation(int vNumber, string vType, float lat, float lon);

        [OperationContract]
        List<Position> getAllVehiclePositions();

        [OperationContract]
        List<int> GetLines();

        [OperationContract]
        List<int> GetLinesByType(String type);

        [OperationContract]
        List<string> GetAllStations();

        [OperationContract]
        Position GetPositionOfStation(string StationName);

        [OperationContract]
        void updateTimeFromTheLastStationColumn(float NewLatitude, float NewLongitude, DateTime insertTime, string guid, int vNumber, string Vtype);

        [OperationContract]
        void addNewLine(List<StationListItem> stations, int VNumber, string vType);

        [OperationContract]
        List<String> GetLinesWithType();
    };


    [DataContract]
    public class StationListItem
    {
        [DataMember]
        public string StationName { get; set; }
        [DataMember]
        public int Snumber { get; set; }

        [DataMember]
        public float Latitude { get; set; }
        [DataMember]
        public float Longiture { get; set; }

        [DataMember]
        public int TimeFromTheLastStation { get; set; }

        [DataMember]
        public int StationID { get; set; }
    }

    [DataContract]
    public class Position
    {
        [DataMember]
        public float Latitude { get; set; }

        [DataMember]
        public float Longitude { get; set; }

        [DataMember]
        public int VehicleNumber { get; set; }
    }
}
